package com.akiokevin.plantyourlife.services;

import android.content.Context;

import com.akiokevin.plantyourlife.database.ScheduleDBAdaptor;
import com.akiokevin.plantyourlife.schedule.ScheduleEntry;

/** 
 * Static definitions / accessor / register for globally shared objects.
 * Original purpose was to have accessor for globally shared Schedule List.
 * Stuffs like ResourceManager is already provided by Android, so I don't think it's necessary to define those here seperately.
 * 
 * @author Kevin Bang
*/
public class Services {
	private static ScheduleDBAdaptor dbAdaptor;
	
	
	
	
	//Database interactions provided by the service
	public static void startDBAdaptor(Context context) {
		dbAdaptor = new ScheduleDBAdaptor(context).open();
	}
	
	public static void closeDBAdaptor() {
		dbAdaptor.close();
	}
	
	public static void insertIntoTemplate(ScheduleEntry entry) {
		dbAdaptor.insertIntoTemplate(entry);
	}
	
	public static void removeFromTemplate(ScheduleEntry entry) {
		dbAdaptor.removeFromTemplate(entry);
	}
	
	public static void insertIntoResult(ScheduleEntry entry, boolean result) {
		dbAdaptor.insertIntoResult(entry, result);
	}
}
